import java.util.LinkedList;


public class Queue {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		
		LinkedList<Integer> queue = new LinkedList<Integer>();
		
		queue.offer(9);
		queue.offer(19);
		queue.offer(5);
		
		System.out.println(queue.poll());
		
		queue.offer(15);
		
		
		System.out.println(queue.poll());
		System.out.println(queue.poll());
		System.out.println(queue.poll());
	}

}
